package service.impl;

import bean.pojo.ParkingRecord;
import dao.ParkingRecordDao;
import dao.ParkingSpaceDao;
import dao.impl.ParkingRecordDaoImpl;
import service.ParkingRecordService;

import java.util.List;

/**
 * bean.pojo.vehicle
 * User: 坚持
 * Date: 2024/12/18 11:34
 * motto: 树欲静而风不止
 * Description:
 * Version: V1.0
 */

public class ParkingRecordServiceImpl implements ParkingRecordService {

    ParkingRecordDao parkingRecordDao = new ParkingRecordDaoImpl();
    @Override
    public List<ParkingRecord> findBy(Integer page, Integer limit, Integer vehicleId, String startParkingTime, String endParkingTime) {
        return parkingRecordDao.findBy(page,limit,vehicleId,startParkingTime,endParkingTime);
    }

    @Override
    public Long findByTotal(Integer vehicleId, String startParkingTime, String endParkingTime) {
        return parkingRecordDao.findByTotal(vehicleId,startParkingTime,endParkingTime);
    }

    @Override
    public Boolean update(ParkingRecord parkingRecord) {
        return parkingRecordDao.update(parkingRecord)>0;
    }

    @Override
    public Boolean deleteById(Integer parkingRecordId) {
        return parkingRecordDao.deleteById(parkingRecordId)>0;
    }

    @Override
    public Boolean add(ParkingRecord parkingRecord) {
        return parkingRecordDao.add(parkingRecord)>0;
    }
}
